#!/usr/bin/python
# -*- coding: utf-8 -*-

name = "whole global name";

class Person:
    name = "class global name"

    def __init__(self, newPersionName):
        #self.name = newPersionName;
        name = newPersionName;

    def sayYourName(self):
        print 'My name is %s'%(self.name);
        print 'name within class Person is actually the global name: %s'%(name);
        print "only access Persion's name via Persion.name=%s"%(Person.name);

def selfAndInitDemo():
    persionInstance = Person("xiaozhi");
    persionInstance.sayYourName();
    print "whole global name is %s"%(name);

if __name__=="__main__":
    selfAndInitDemo();
